package com.artist.service.Impl;

import com.artist.entity.TbUser;
import com.artist.mapper.UserMapper;
import com.artist.service.UserService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;
@Service("userService")
public class UserServiceImpl implements UserService {
    @Autowired
    private UserMapper userMapper;

    @Override
    public List<TbUser> selectAll() {
        return userMapper.selectAll();
    }

    @Override
    public TbUser selectUserPrimaryKey(Integer uid) {
        return userMapper.selectByPrimaryKey(uid);
    }

    @Override
    public void savaUser(TbUser tbUser) {
        userMapper.insert(tbUser);

    }

    @Override
    public int deleteUserPrimaryKey(Integer uid) {
        userMapper.deleteByPrimaryKey(uid);
        return 0;
    }

    @Override
    public void updateUserPrimaryKeySelective(TbUser tbUser) {
        userMapper.updateByPrimaryKeySelective(tbUser);
    }
}
